#include "softvec_type.h"
    .h8300h
    .section .text

    .global _intr_serrecv1
_intr_serrecv1:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_SERRECV1,r6
    jmp     intr_common

    .global _intr_sersend1
_intr_sersend1:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_SERSEND1,r6
    jmp     intr_common

    .global _intr_ethintr
_intr_ethintr:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_ETHINTR,r6
    jmp     intr_common

    .global _intr_t16intr_0
_intr_t16intr_0:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_T16INTR_0,r6
    jmp     intr_common

    .global _intr_t16intr_1
_intr_t16intr_1:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_T16INTR_1,r6
    jmp     intr_common

    .global _intr_t16intr_2
_intr_t16intr_2:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_T16INTR_2,r6
    jmp     intr_common

    .global _intr_t8intr_01
_intr_t8intr_01:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_T8INTR_01,r6
    jmp     intr_common

    .global _intr_t8intr_23
_intr_t8intr_23:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_T8INTR_23,r6
    jmp     intr_common

    .global _intr_trap0
_intr_trap0:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_TRAP0,r6
    jmp     intr_common

    .global _intr_trap1
_intr_trap1:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_TRAP1,r6
    jmp     intr_common

    .global _intr_trap2
_intr_trap2:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_TRAP2,r6
    jmp     intr_common

    .global _intr_trap3
_intr_trap3:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_TRAP3,r6
    jmp     intr_common

    .global _intr_dmac0
_intr_dmac0:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_DMAC0,r6
    jmp     intr_common

    .global _intr_dmac1
_intr_dmac1:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_DMAC1,r6
    jmp     intr_common

    .global _intr_wdt
_intr_wdt:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_WDT,r6
    jmp     intr_common

    .global _intr_default
_intr_default:
    mov.l   er6,@-er7
    mov.w   #SOFTVEC_TYPE_DEFAULT,r6
#    jmp     intr_common

intr_common:
    mov.l   er5,@-er7
    mov.l   er4,@-er7
    mov.l   er3,@-er7
    mov.l   er2,@-er7
    mov.l   er1,@-er7
    mov.l   er0,@-er7
    mov.l   er7,er1
    mov.l   #_intrstack,sp
    mov.l   er1,@-er7
    mov.w   r6,r0
    jsr     _interrupt
    mov.l   @er7+,er1
    mov.l   er1,er7
    mov.l   @er7+,er0
    mov.l   @er7+,er1
    mov.l   @er7+,er2
    mov.l   @er7+,er3
    mov.l   @er7+,er4
    mov.l   @er7+,er5
    mov.l   @er7+,er6
    rte
